import jsencrypt from './jsencrypt.js'
// 密钥对生成 http://web.chacuo.net/netrsakeypair
 
const publicKey = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCfxYtZzD3Fjno9K/Xb97gIc6vO+ck/F0geBnZFuYPUohrRPFV80D0t119e/fSBb+fEA3ehom3qmAabU6dXdIRhLlTRuxvGUj9FVldx/N8G8ZoO+WrVFOGwGGp/j1/KJ0SaruSStNNkW9PKCzf3yuoD6ddzxQn17/Dor1NUVvGj9QIDAQAB'
 
const privateKey = '秘钥'
 
// 加密
export const encrypt = (data)=> {
  let cryptFirst = new  jsencrypt()
  cryptFirst.setPublicKey(publicKey)
  return cryptFirst.encrypt(data) || ''
}
 
